package com.fancy.net.stream
{
	import com.fancy.net.stream.login.LoginBack;
	import com.fancy.net.stream.login.LoginReq;
	
	import flash.utils.Dictionary;

	public class StreamDic
	{
		private static var _decodeDic:Dictionary = new Dictionary();
		private static var _encodeDic:Dictionary = new Dictionary();
		
		public function StreamDic()
		{
		}
		
		public static function initialize():void
		{
			_encodeDic["0103"] = new LoginReq();
			_decodeDic["0104"] = new LoginBack();
		}
		
		public static function getDecoder(cmd:String):DecodeBase
		{
			if(_decodeDic[cmd]) { return _decodeDic[cmd]; }
			return null;
		}
		
		public static function getEncoder(cmd:String):EncodeBase
		{
			if(_encodeDic[cmd]) { return _encodeDic[cmd]; }
			return null;
		}
		
	}
}